fix: always show alerting for anon users#5625
Open
fabio-silva wants to merge 5 commits into
Open
Conversation
fabio-silva
requested review from
matejkubinec and
mattiasimonato
and removed request for
a team
July 9, 2026 10:53
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the PMM UI sidebar navigation logic to make Grafana Alerting visible for anonymous users (treating them more like Viewer users), and adjusts some navigation items to better reflect authentication state.
Changes:
- Refactors
addAlertingto take separatealertingEnabledandunifiedAlertingEnabledflags and conditionally include certain sub-items. - Updates
NavigationProviderto render more of the navigation tree for anonymous users while hiding the Account menu unless the user is actually logged in. - Adds
useAuth()usage to distinguish “has a user object” vs “is logged in”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/apps/pmm/src/contexts/navigation/navigation.utils.tsx | Refactors alerting nav item construction to incorporate unified alerting state. |
| ui/apps/pmm/src/contexts/navigation/navigation.provider.tsx | Adjusts sidebar item inclusion based on user, settings, and isLoggedIn to support anonymous visibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+81
to
+85
| items.push( | ||
| addAlerting( | ||
| settings?.alertingEnabled, | ||
| settings?.frontend.unifiedAlertingEnabled, | ||
| user |
Comment on lines
143
to
147
| children.push(NAV_ALERTS_RULES); | ||
| children.push(NAV_ALERTS_CONTACT_POINTS); | ||
| children.push(NAV_ALERTS_NOTIFICATION_POLICIES); | ||
| children.push(NAV_ALERTS_SILENCES); | ||
| children.push(NAV_ALERTS_GROUPS); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket number: PMM-15067